package com.wymobilearchitecture.heade_frist.state.state;

import com.wymobilearchitecture.heade_frist.state.CandyMachine;

/**
 * 发糖状态
 * 执行发糖逻辑
 */
public class DispenseCandyStateItem implements State{

    private CandyMachine candyMachine;
    public DispenseCandyStateItem(CandyMachine candyMachine){
        this.candyMachine = candyMachine;
    }
    @Override
    public void insertQuarter() {
        System.out.println("发糖中.无须投币");
        candyMachine.setState(candyMachine.dispenseCandyStateItem);
    }

    @Override
    public void ejectQuarter() {
        System.out.println("发糖中.无法退币");
        candyMachine.setState(candyMachine.dispenseCandyStateItem);
    }

    @Override
    public void dispense() {
        System.out.println("发糖中.请等待");
        candyMachine.setState(candyMachine.dispenseCandyStateItem);
    }
}
